/**
 * 
 */
package com.p2p.front.dal.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import com.p2p.base.dao.BaseMapper;
import com.p2p.base.page.PageVo;
import com.p2p.front.dal.model.MemberPointLog;

/**
 * @author ruiqi
 *
 */
public interface MemberPointLogDao extends BaseMapper{
	String tableName = "p2p_member_point_log";
	String columns = "user_id,type,direction,point,logTime";
	
	@Insert("insert into "+tableName+"("+columns+")values(#{userId},#{type},#{direction},#{point},#{logTime})")
	void create(MemberPointLog memberPointLog);
	
	@ResultMap("MemberPointLogResultMap")
	@Select("select "+columns+" from "+tableName+" where user_id=#{userId} order by logTime desc")
	List<MemberPointLog> queryLogByUserId(String userId);
	
	@Select("select * from p2p_member_point_log order by logTime desc")
	List<Map<String,Object>> list(PageVo form);
}
